# name : gsDesign gsDesign
# key : gsDesign.gsDesign.simple
# contributor: Shuguang Sun
# --
# number of analyses (interim + final)
k <- ${1:2}
# test.type 1 vs 2 sided, symmetric vs asymmetric, etc
test.type = ${2:$$(yas-choose-value '("1" "2" "3" "4" "5" "6"))}
# Type I error (1-sided)
alpha <- ${3:0.025}
# Type II error (1-power)
beta <- ${4:0.1}
# effec size, if n.fix = NULL to generate n.fix
delta <- ${5:0}
# n or events for fixed design
n.fix <- ${6:1}
# timing of interim analyses (k-1 increasing numbers >0 and <1)
# proportion of final events at each interim
timing <- ${7:0.67}
# efficacy bound spending function
# We use Lan-DeMets spending function approximating O'Brien-Fleming bound
# no parameter required for this spending function
sfu <- ${8:$$(yas-choose-value '("sfLDOF" "sfLDPocock" "sfHSD" "sfPoints" "OF" "Pocock" "WT"))}
sfupar <- NULL
# futility bound spending function
sfl <- ${9:$$(yas-choose-value '("NULL" "sfHSD" "sfLDOF" "sfLDPocock" "sfPoints"))}
# futility bound spending parameter specification
sflpar <- -2
# optional: endpoint
endpoint <- \"${10:$$(yas-choose-value '("TTE" "Binomial"))}\"
# natural parameter scale
delta1 <- 1
delta0 <- 0
# randomization ratio, experimental/control
# ratio <- 1
# generate design
gs1 <- gsDesign(
k = k, test.type = test.type, alpha = alpha, beta = beta,
timing = timing,
sfu = sfu, sfupar = sfupar,
sfl = sfl, sflpar = sflpar
)
gs1
